import os
import shutil
from tqdm import tqdm

SrcDir = r"/media/fang/TOSHIBA EXT/Temp/600_300/M"
AnnotationDir = r"/home/fang/CaffeDemo/caffe/data/MyDataSet/600x300/Annotations"
JpgDir = r"/home/fang/CaffeDemo/caffe/data/MyDataSet/600x300/JPEGImages"

for root, dirs, files in os.walk(SrcDir):
    for file in tqdm(files):
        if file[-1] == 'l':
            shutil.copyfile(root + "/" + file, AnnotationDir + "/" + file)
        if file[-1] == 'g':
            shutil.copyfile(root + "/" + file, JpgDir + "/" + file)

print("------------------------done-------------------------")
